package com.yunhuajinfu.response;

import com.yunhuajinfu.entity.BannerList;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;

public class BannerRes {
	
    private ArrayList<BannerList> bannerList;
    
    
	public BannerRes () {
		
	}	
        
    public BannerRes (JSONObject json) {
    

        this.bannerList = new ArrayList<BannerList>();
        JSONArray arrayBannerList = json.optJSONArray("bannerList");
        if (null != arrayBannerList) {
            int bannerListLength = arrayBannerList.length();
            for (int i = 0; i < bannerListLength; i++) {
                JSONObject item = arrayBannerList.optJSONObject(i);
                if (null != item) {
                    this.bannerList.add(new BannerList(item));
                }
            }
        }
        else {
            JSONObject item = json.optJSONObject("bannerList");
            if (null != item) {
                this.bannerList.add(new BannerList(item));
            }
        }


    }
    
    public ArrayList<BannerList> getBannerList() {
        return this.bannerList;
    }

    public void setBannerList(ArrayList<BannerList> bannerList) {
        this.bannerList = bannerList;
    }


    
}
